$(function() {
	var sessionId = sessionStorage.getItem('sessionId');
	console.log(sessionId);
	$(".submission").click(function(){
		var issueTitle = $('#issueTitle').val()
		var issueCause = $('#issueCause').val()
		var issueContent = $('#issueContent').val()
		//if(!issueTitle){
		//	layer.msg('不能为空')
		//}else if(!issueCause){
		//	layer.msg('2不能为空')
		//}else if(!issueContent){
		//	layer.msg('3不能为空')
		//}
		$.ajax({
			type:"post",
			url:"https://www.bjdeshangyuan.com/book/api/issue/save",
			data:{
				'sessionid':sessionId,
				'issueTitle':issueTitle,
				'issueCause':issueCause,
				'issueContent':issueContent
			},
			success:function(data){
				console.log(data);

				if(data.code =="USR000"){
					alert("提交成功！")
				}
			}
		})
	})
	
	/* 返回上一级页面 */
	$("#back").click(function(){
		window.history.back();
	})

})